using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Distance
{
    /// <summary>
    /// <para>Optimal Path As Line</para>
    /// <para>Calculates the optimal path from a source to a destination as a line.</para>
    /// <para>以线的形式计算从源到目标的最佳路径。</para>
    /// </summary>    
    [DisplayName("Optimal Path As Line")]
    public class OptimalPathAsLine : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public OptimalPathAsLine()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_destination_data">
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>An integer raster or feature dataset that identifies locations from which the optimal path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, it must consist of cells that have valid values for the destinations, and the remaining cells must be assigned NoData. Zero is a valid value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>整数栅格或要素数据集，用于标识从中确定到成本最低的源的最佳路径的位置。</para>
        ///   <para>如果输入为栅格，则该输入必须由具有目标有效值的像元组成，并且必须为其余像元分配 NoData。零是有效值。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_distance_accumulation_raster">
        /// <para>Input distance accumulation raster</para>
        /// <para><xdoc>
        ///   <para>The distance accumulation raster is used to determine the optimal path from the sources to the destinations.</para>
        ///   <para>The distance accumulation raster is usually created with the Distance Accumulation or Distance Allocation tools. Each cell in the distance accumulation raster represents the minimum accumulative cost distance over a surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>距离累积栅格用于确定从源到目标的最佳路径。</para>
        ///   <para>距离累积栅格通常使用距离累积或距离分配工具创建。距离累积栅格中的每个像元表示从每个像元到一组源像元的表面上的最小累积成本距离。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_back_direction_raster">
        /// <para>Input back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The back direction raster contains calculated directions in degrees. The direction identifies the next cell along the optimal path back to the least accumulative cost source while avoiding barriers.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>返回方向栅格包含以度为单位的计算方向。该方向沿最佳路径确定下一个单元，返回到累积成本最低的来源，同时避免障碍。</para>
        ///   <para>值的范围为 0 度到 360 度，其中 0 保留给源像元。正东（右）为 90，值顺时针递增（180 为南，270 为西，360 为北）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_polyline_features">
        /// <para>Output optimal path as feature</para>
        /// <para>The output feature class that is the optimal path or paths.</para>
        /// <para>作为最佳路径的输出要素类。</para>
        /// </param>
        public OptimalPathAsLine(object _in_destination_data, object _in_distance_accumulation_raster, object _in_back_direction_raster, object _out_polyline_features)
        {
            this._in_destination_data = _in_destination_data;
            this._in_distance_accumulation_raster = _in_distance_accumulation_raster;
            this._in_back_direction_raster = _in_back_direction_raster;
            this._out_polyline_features = _out_polyline_features;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Optimal Path As Line";

        public override string CallName => "sa.OptimalPathAsLine";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "geographicTransformations", "maintainSpatialIndex", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_destination_data, _in_distance_accumulation_raster, _in_back_direction_raster, _out_polyline_features, _destination_field, _path_type.GetGPValue(), _create_network_paths.GetGPValue()];

        /// <summary>
        /// <para>Input raster or feature destination data</para>
        /// <para><xdoc>
        ///   <para>An integer raster or feature dataset that identifies locations from which the optimal path is determined to the least costly source.</para>
        ///   <para>If the input is a raster, it must consist of cells that have valid values for the destinations, and the remaining cells must be assigned NoData. Zero is a valid value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>整数栅格或要素数据集，用于标识从中确定到成本最低的源的最佳路径的位置。</para>
        ///   <para>如果输入为栅格，则该输入必须由具有目标有效值的像元组成，并且必须为其余像元分配 NoData。零是有效值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster or feature destination data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_destination_data { get; set; }


        /// <summary>
        /// <para>Input distance accumulation raster</para>
        /// <para><xdoc>
        ///   <para>The distance accumulation raster is used to determine the optimal path from the sources to the destinations.</para>
        ///   <para>The distance accumulation raster is usually created with the Distance Accumulation or Distance Allocation tools. Each cell in the distance accumulation raster represents the minimum accumulative cost distance over a surface from each cell to a set of source cells.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>距离累积栅格用于确定从源到目标的最佳路径。</para>
        ///   <para>距离累积栅格通常使用距离累积或距离分配工具创建。距离累积栅格中的每个像元表示从每个像元到一组源像元的表面上的最小累积成本距离。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input distance accumulation raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_distance_accumulation_raster { get; set; }


        /// <summary>
        /// <para>Input back direction or flow direction raster</para>
        /// <para><xdoc>
        ///   <para>The back direction raster contains calculated directions in degrees. The direction identifies the next cell along the optimal path back to the least accumulative cost source while avoiding barriers.</para>
        ///   <para>The range of values is from 0 degrees to 360 degrees, with 0 reserved for the source cells. Due east (right) is 90, and the values increase clockwise (180 is south, 270 is west, and 360 is north).</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>返回方向栅格包含以度为单位的计算方向。该方向沿最佳路径确定下一个单元，返回到累积成本最低的来源，同时避免障碍。</para>
        ///   <para>值的范围为 0 度到 360 度，其中 0 保留给源像元。正东（右）为 90，值顺时针递增（180 为南，270 为西，360 为北）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input back direction or flow direction raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_back_direction_raster { get; set; }


        /// <summary>
        /// <para>Output optimal path as feature</para>
        /// <para>The output feature class that is the optimal path or paths.</para>
        /// <para>作为最佳路径的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output optimal path as feature")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_polyline_features { get; set; }


        /// <summary>
        /// <para>Destination field</para>
        /// <para>An integer field to be used to obtain values for the destination locations.</para>
        /// <para>用于获取目标位置值的整数字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_field { get; set; } = null;


        /// <summary>
        /// <para>Path type</para>
        /// <para><xdoc>
        ///   <para>Specifies a keyword defining the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>Each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Best single—For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///     <bullet_item>Each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定一个关键字，用于定义在成本路径计算中解释输入目标数据的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</bullet_item><para/>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</bullet_item><para/>
        ///     <bullet_item>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _path_type_value _path_type { get; set; } = _path_type_value._EACH_ZONE;

        public enum _path_type_value
        {
            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single—For all cells on the input destination data, the least-cost path is derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据上的所有像元，开销最低的路径是从到源像元的开销最低路径的像元派生的。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

            /// <summary>
            /// <para>Each cell</para>
            /// <para>Each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data is treated separately, and a least-cost path is determined for each cell.</para>
            /// <para>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("Each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>Each zone</para>
            /// <para>Each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone begins at the cell with the lowest cost distance weighting in the zone.</para>
            /// <para>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径从区域中成本距离加权最低的像元开始。</para>
            /// </summary>
            [Description("Each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

        }

        /// <summary>
        /// <para>Create network paths</para>
        /// <para><xdoc>
        ///   <para>Specifies whether complete, and possibly overlapping, paths from the destinations to the sources are calculated or if nonoverlapping network paths are created.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Complete paths from the destinations to the sources are calculated, which can be overlapping. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Nonoverlapping network paths are calculated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否计算从目标到源的完整路径（可能重叠的路径），或者是否创建不重叠的网络路径。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 将计算从目标到源的完整路径，该路径可以重叠。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 计算非重叠网络路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create network paths")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _create_network_paths_value _create_network_paths { get; set; } = _create_network_paths_value._false;

        public enum _create_network_paths_value
        {
            /// <summary>
            /// <para>DESTINATIONS_TO_SOURCES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DESTINATIONS_TO_SOURCES")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>NETWORK_PATHS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NETWORK_PATHS")]
            [GPEnumValue("true")]
            _true,

        }

        public OptimalPathAsLine SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object geographicTransformations = null, bool? maintainSpatialIndex = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, geographicTransformations: geographicTransformations, maintainSpatialIndex: maintainSpatialIndex, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}